package zblibrary.facechat.modules.lookinggood;

import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableList;

import java.util.ArrayList;
import java.util.List;

import lingxi.entity.User;
import zblibrary.facechat.entity.LookingGoodEntity;


public class LookingGoodViewModel {
    private ObservableList<LookingGoodEntity> lookingGoodList;

    public int totalSize() {
        return lookingGoodList.size();
    }

    public void initData() {
        lookingGoodList = new ObservableArrayList<LookingGoodEntity>();
        syncData();
    }

    public void syncData() {
        ArrayList<String> photoList = new ArrayList<String>(){{}};
        lookingGoodList.clear();
        for (int i = 0; i < 20; i++) {
            User user = new User();
            user.setUsername("捡到人——"+i);
            user.setAvatar("http://42.194.193.182:5000/images/goods/1.jpg");
            LookingGoodEntity entity = new LookingGoodEntity(user,"1234567890123", photoList,false);
            lookingGoodList.add(entity);
        }
    }

    public List<LookingGoodEntity> getlookingGoodList() {
        return lookingGoodList;
    }
}
